//
//  ARTWathDataAnalysis.h
//  ChartsDemo
//
//  Created by yunda on 2021/10/25.
//

#import <Foundation/Foundation.h>
#import "ARTWathDataModel.h"
#import "ARTWatchHisModel.h"

NS_ASSUME_NONNULL_BEGIN

typedef void (^AnalysisCallback)(ARTWathDataModel *_Nullable dataModel);
// 0x10数据包回调
typedef void (^Analysis_0x10_Callback)(ARTWathDataModel *_Nullable dataModel);
// 0x13数据包回调
typedef void (^Analysis_0x13_Callback)(BOOL stop);
// 0x14数据包回调
typedef void (^Analysis_0x14_Callback)(NSData *_Nullable datas);
// 0x15数据包回调
typedef void (^Analysis_0x15_Callback)(ARTWatchHisModel *_Nullable hisModel);
// 同步完回调
typedef void (^Analysis_syncComplete_Callback)(NSArray *_Nullable hisArray);
// 0x1B数据包回调
typedef void (^Analysis_0x1B_Callback)(NSData *_Nullable datas);
// 0x1C数据包回调
typedef void (^Analysis_0x1C_Callback)(NSData *_Nullable datas);
// 0x1D数据包回调
typedef void (^Analysis_0x1D_Callback)(NSData *_Nullable datas,BOOL complete);

@interface ARTWathDataAnalysis : NSObject

@property (copy, nonatomic)  Analysis_0x10_Callback call_0x10_back;

@property (copy, nonatomic)  Analysis_0x14_Callback call_0x14_back;

@property (copy, nonatomic)  Analysis_0x13_Callback call_0x13_back;

@property (copy, nonatomic)  Analysis_0x15_Callback call_0x15_back;

@property (copy, nonatomic)  Analysis_syncComplete_Callback call_syncComplete_back;

@property (copy, nonatomic)  Analysis_0x1B_Callback call_0x1B_back;

@property (copy, nonatomic)  Analysis_0x1C_Callback call_0x1C_back;

@property (copy, nonatomic)  Analysis_0x1D_Callback call_0x1D_back;


// 是否同步设备文件标识
@property (assign, nonatomic)  BOOL isSyncFile;

// 是否同步设备文件标识
//@property (strong, nonatomic)  NSMutableData *bufferData;

#pragma mark-----------DATA-----------
// 解析数据
- (void)analysisData:(NSData *)data;

// 同步所有文件列表
- (BOOL)syncAllFileList;

// 同步完成回调
- (void)syncAllComplete;

// 清除缓存数据
- (void)clearData;

#pragma mark-----------CMD-----------
// 同步时间戳
+ (NSData *)syncTimestamp;

// 同步类型
+ (NSData *)syncMeasuringType:(ARTWatchMonitorType)type;

// 同步结束
+ (NSData *)syncStop;

// 同步删除
//+ (NSData *)synDelete;

// 获取设备总条数
+ (NSData *)getDeviceHisAllCount;

#pragma mark - 安全
- (void)sendSafe:(dispatch_block_t)complete;

@end

NS_ASSUME_NONNULL_END
